home *** CD-ROM | disk | FTP | other *** search
- #include <QuickDraw.h>
- #include <MacTypes.h>
- #include <WindowMgr.h>
- #include <TextEdit.h>
- #include <ControlMgr.h>
- #include <EventMgr.h>
- #include "DalDemo.h"
-
- extern MenuHandle gAppleMenu, gFileMenu, gEditMenu;
- extern Rect gDragRect;
- extern DialogPtr gLogonDialog;
- extern Boolean gDone, gWNEImplemented, gDALActive, gDALMonitor, gDALNewCodeFrag;
- extern long gTimer, gCounter;
- extern int gDALState;
-
- /*** ToolBoxInit ***/
- ToolBoxInit()
- {
- InitGraf( &thePort);
- InitFonts();
- FlushEvents(everyEvent,REMOVE_ALL_EVENTS);
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs(NIL);
- InitCursor();
- }
-
- /***GlobalVarInit***/
- void GlobalVarInit()
- {
- gDone = FALSE;
- gWNEImplemented = (NGetTrapAddress( WNE_TRAP_NUM, ToolTrap) !=
- NGetTrapAddress( UNIMPL_TRAP_NUM, ToolTrap));
-
- gTimer = TickCount();
- gCounter = 0L;
- gDALState = 0;
- gDALActive = FALSE;
- gDALMonitor = FALSE;
- gDALNewCodeFrag = FALSE;
- }
-
- /*** MenuBarInit ***/
- MenuBarInit()
- {
- Handle myMenuBar;
-
- if ((myMenuBar = GetNewMBar(RSRC_BASE)) == NIL) ErrorHandler(NO_MBAR);
- SetMenuBar(myMenuBar);
- if ((gAppleMenu = GetMHandle(APPLE_MENU_ID)) == NIL) ErrorHandler(NO_MENU);
- AddResMenu(gAppleMenu, 'DRVR');
- if ((gFileMenu = GetMHandle(FILE_MENU_ID)) == NIL) ErrorHandler(NO_MENU);
- if ((gEditMenu = GetMHandle(EDIT_MENU_ID)) == NIL) ErrorHandler(NO_MENU);
- DrawMenuBar();
- }
-
- /*** SetUpDragRect ***/
- SetUpDragRect()
- {
- gDragRect = screenBits.bounds;
- gDragRect.left += DRAG_THRESH;
- gDragRect.right -= DRAG_THRESH;
- gDragRect.bottom -= DRAG_THRESH;
- }
-